package com.zl.design.adapter.service;

import com.alibaba.fastjson.JSON;
import com.zl.design.adapter.model.OrderMq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class OrderService {

    private Logger logger = LoggerFactory.getLogger(POPOrderService.class);

    /**
     * 查询内部订单书
     * @param userId
     * @return
     */
    public long queryUserOrderCount(String userId){
        logger.info("自营商家，查询用户的订单是否为首单：{}", userId);
        return 10L;
    }

    public void onMessage(String message) {

        OrderMq mq = JSON.parseObject(message, OrderMq.class);

        mq.getUid();
        mq.getOrderId();
        mq.getCreateOrderTime();

        // ... 处理自己的业务
    }


}
